/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package manager;

import entity.Order;
import java.util.ArrayList;

/**
 *
 * @author NgocNam
 */
public class managerOrder {
    private  ArrayList<Order> list;

     public managerOrder() {
        list = new ArrayList<Order>();
    }

    public void addOrder(Order o) {
        list.add(o);
    }
        
    public void addOrder(ArrayList<Order> list) {
        this.list.addAll(list);
    }

    public void removeOrder(Order o) {
        this.list.remove(o);
    }
    

    public void updateOrder(Order o) {
        for (int i = 0; i < this.list.size(); i++) {
            if (list.get(i).getOrderID() == o.getOrderID()) {
                list.set(i, o);
            }
        }

    }

    public Order getOrder(int index) {
       return  this.list.get(index);
    }

    public int getSize() {
        return list.size();
    }
}
